home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
comm
/
fido
/
tdisp11.lha
/
TrapDispatcher
/
Rexx
/
Deliver.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-11-15
|
2KB
|
101 lines
/*
Deliver.rexx 1.0
This script scans your outbound directory for mail bundles and/or
filerequests and calls the node they are destined for.
Deliver only recognizes a 4D-style outbound directory, that is the
files should be named zone.net.node.point.*. Does anybode use the old
2D-style anyway?
Usage: rx Deliver.rexx [+D] [+C] [+N] [+R] <options>
+D Send direct mail
+C Send crashmail
+N Send normal mail
+R Send filerequests
<options> Options that are passed to TrapDispatcher
Example: rx Deliver.rexx +C +D UNTIL 04:30
*/
/* Change these to suit your system */
dispatchport="TRAPDISPATCHER"
outbound="MAIL:Outbound"
/* Real script starts here */
options results
options failat 11 /* Don't show error 10 in CLI... */
IF ~SHOW(Libraries,'rexxsupport.library') THEN
IF ~ADDLIB("rexxsupport.library",0,-30,0) THEN EXIT
buf=arg(1)
opt=""
parse var buf option buf
do while option~=""
if left(option,1)="+" then do
if upper(left(option,2))="+N" then sendflo=TRUE
else if upper(left(option,2))="+R" then sendreq=TRUE
else if upper(left(option,2))="+D" then senddlo=TRUE
else if upper(left(option,2))="+C" then sendclo=TRUE
else do
say "Unknown option" option
exit
end
end
else do
/* Join other options so that we can pass them to TrapDispatcher */
if opt~="" then opt=opt || " "
opt=opt || option
end
parse var buf option buf
end
address command "List lformat %s PAT #?.#?.#?.#?.(REQ|FLO|DLO|CLO) >T:Deliver.tmp " || outbound
call open('file','T:Deliver.tmp','R')
do while ~eof('file')
buf=readln('file')
if buf~="" then do
/* Separate dotted node number from extenssion */
ext=right(buf,3)
main=left(buf,length(buf)-4)
/* Make FidoNet address */
parse var main zone"."net"."node"."point
addr=zone":"net"/"node"."point
send=false
if upper(ext)="REQ" & sendreq=true then send=TRUE
if upper(ext)="FLO" & sendflo=true then send=TRUE
if upper(ext)="DLO" & senddlo=true then send=TRUE
if upper(ext)="CLO" & sendclo=true then send=TRUE
if send=true then do
address value dispatchport
'call 'addr' 'opt
geterror
say addr || ", " || result
end
end
end
call close('file')
call delete('T:Deliver.tmp')